/**
*		@file Follows.h
*		@brief Follows class
*
*		@author Zhou Nan
*
*		@date 1/25/2012
*/

#ifndef FOLLOWS_H
#define FOLLOWS_H

#include "StmtTable.h"
using namespace std;

class Follows{
public:
	static void RebuildFollows();

	static void CompleteFollows();

	/**
	*		This method will get StmtSet of s, such that Follows(stmt_num_left, s)
	*/
	static StmtSet&	GetFollowsRight(StmtNum stmt_num_left);

	/**
	*		This method will get StmtSet of s, such that Follows(s, stmt_num_right)
	*/
	static StmtSet&	GetFollowsLeft(StmtNum stmt_num_right);

	/**
	*		This method will get StmtSet of s, such that Follows*(stmt_num_left, s)
	*/
	static StmtSet&	GetFollowsAdvRight(StmtNum stmt_num_left);

	/**
	*		This method will get StmtSet of s, such that Follows*(s, stmt_num_right)
	*/
	static StmtSet&	GetFollowsAdvLeft(StmtNum stmt_num_right);

	/**
	*		This method will check if Follows(stmt_num_left, stmt_num_right)
	*/
	static bool		IsFollows(StmtNum stmt_num_left, StmtNum stmt_num_right);
	
	/**
	*		This method will check if Follows*(stmt_num_left, stmt_num_right)
	*/
	static bool		IsFollowsAdv(StmtNum stmt_num_left, StmtNum stmt_num_right);

	/**
	*		This method will return a string representation of Follows relation
	*/
	static string	ToString();

private:;
	static vector<StmtSet>	follows_table_;
	static vector<StmtSet>	follows_table_t_;
	static vector<StmtSet>	follows_adv_table_;
	static vector<StmtSet>	follows_adv_table_t_;

	static StmtSet			follows_has_s0_;	//follows(s,_),follows*(s,_)
	static StmtSet			follows_has_0s_;	//follows(_,s),follows*(_,s)
	static bool				follows_has_00_;	//follows(_,_),follows*(_,_)
};

#endif